import { studentMenu } from "@/config/student";
import { teacherMenu } from "@/config/teacher";
import { administratorMenu } from "@/config/administrator";
import { delearMenu } from "@/config/delear";
import { operationMenu } from "@/config/operation";
import { useRoleStore } from "@/store/modules/roles";
import { schoolMenu } from "@/config/school";
export const setAuth = (role: string) => {
    // 模拟登录后获取token,模拟用户角色
    //    localStorage.setItem("token", "123456");
    //    localStorage.setItem("role", "4");
    localStorage.setItem("role", role);
    let roleStore = useRoleStore();
    switch (role) {
        //
        case "0": //operation 是平台运维和超管角色
            roleStore.setMenuList(operationMenu);
            break;
        case "1": //delear 是经销商角色
            roleStore.setMenuList(delearMenu);
            break;
        case "2": //school 是学校管理员角色
            roleStore.setMenuList(schoolMenu);
            break;
        case "4": //student 是学生角色
            roleStore.setMenuList(studentMenu);
            break;
        case "3"://teacher 是老师角色
            roleStore.setMenuList(teacherMenu);
            break;
        case "9": //administrator 是超管角色
            roleStore.setMenuList(administratorMenu);
            break;
        default:
            roleStore.setMenuList(operationMenu);
    }
    return true;
}